<template>
  <el-breadcrumb separator-class="el-icon-arrow-right">
    <el-breadcrumb-item to="home">首页</el-breadcrumb-item>
    <el-breadcrumb-item v-for="(item,index) in label" :key="index">{{item}}</el-breadcrumb-item>
  </el-breadcrumb>
</template>

<script>
export default {
  name: 'Breadcrumb',
  data () {
    return {
      label: []
    }
  },
  created () {
    this.$route.matched.forEach(el => {
      if (el.path !== '/home') {
        this.label.push(el.meta.titel1)
        this.label.push(el.meta.titel2)
      }
    })
  }
}
</script>

<style lang="less" scoped>
.el-breadcrumb{
  margin-bottom: 20px;
}
</style>
